package com.acoreful.acf2admin.modules.quartz;

import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.stereotype.Service;
@Service
public class SpringContextHelper implements ApplicationContextAware{ 
	private Logger logger=LoggerFactory.getLogger(SpringContextHelper.class);
    private static ApplicationContext context;  
    @Override  
    public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {  
        context = applicationContext;
        logger.info("***************************** setApplicationContext init !!!!!!!!!!!");
    }  
    public static Object getBean(String beanName){  
        return context.getBean(beanName);  
    }  
    public static <T> Object getBeanByClass(Class<T> c){  
        return context.getBean(c);  
    }
}  